#! /bin/sh
# 
# Laptop mode tools module: Power management for Intel SATA controllers
#

if [ x$CONTROL_INTEL_SATA_POWER = x1 ] ; then
	for POLICYFILE in /sys/class/scsi_host/*/link_power_management_policy ; do
		if [ -f $POLICYFILE ] ; then
			log "VERBOSE" "Intel SATA link power saving enabled."
			echo min_power > $POLICYFILE
		else
			log "VERBOSE" "Intel SATA link power saving enabled but not supported by system."
		fi 
	done
else
	log "VERBOSE" "Intel SATA link power saving disabled."
fi

